import pandas as pd
import numpy as np

s = pd.Series([1,2,3,np.nan,44,1])
print(s)
#输出
#0     1.0
#1     2.0
#2     3.0
#3     NaN
#4    44.0
#5     1.0
#dtype: float64

dates = pd.date_range('20180304',periods=6)
print(dates)
#输出为
#DatetimeIndex(['2018-03-04', '2018-03-05', '2018-03-06', '2018-03-07',
#               '2018-03-08', '2018-03-09'],
#              dtype='datetime64[ns]', freq='D')

df = pd.DataFrame(np.random.randn(6,4),index=dates,columns=["a","b","c","d"])
print(df)
#输出为
#                   a         b         c         d
#2018-03-04 -1.749083 -0.361568  0.262959  0.218123
#2018-03-05 -1.009296  0.299836 -1.381302  0.357131
#2018-03-06  0.957699  0.143212  0.999339 -0.493833
#2018-03-07 -0.769791 -0.262177 -2.328284  0.912793
#2018-03-08  1.036628 -0.858380  0.705099 -1.314505
#2018-03-09  0.023663  0.348749 -0.513325 -0.065453

print(df)